function minArray(numbers: number[]): number {
    // if(numbers.length == 1){
    //     return numbers[0];
    // }
    let l = 0;
    let r = numbers.length - 1;
    // 没有旋转
    if (numbers[l] < numbers[r]) {
        return numbers[l];
    }

    let center = Math.floor((l + r) / 2);
    while (r - l > 1) {
        while (numbers[l] == numbers[center] && r - l > 1) {
            l++;
            center = Math.floor((l + r) / 2);
        }
        while (numbers[r] == numbers[center] && r - l > 1) {
            r--;
            center = Math.floor((l + r) / 2);
        }
        while (numbers[l] < numbers[center] && r - l > 1) {
            // console.log(l,center);
            l = center + 1;
            center = Math.floor((l + r) / 2);
        }
        while (numbers[r] > numbers[center] && r - l > 1) {
            // console.log(r,center);

            r = center;
            center = Math.floor((l + r) / 2);
        }
    }

    return numbers[r] > numbers[l] ? numbers[l] : numbers[r];
};

console.log(minArray([1, 1, 1]));

